package fr.umlv.m2.jee.spij.service.course;

import org.springframework.binding.message.MessageContext;

import java.util.List;
/**
 * Provides methods to retrieve courses into databases from DAO.
 * @author lounes
 *
 */
public interface IDisplayCourseService {

    /**
     * Returns all the courses given for a unit.
     *
     * @param context
     *
     * @return a list of DTO that contains the displayed data
     */
    public List<DisplayCourse> getAllDisplayCourses(MessageContext context);

    /**
     * Returns all the courses given for a trainning.
     *
     * @param trainingName the training name
     *
     * @return a list of DTO that contains the displayed data
     */
    public List<DisplayCourse> getAllDisplayCoursesByTrainingName(
            String trainingName, MessageContext context);

    /**
     * add a course in course list
     * check the ambiguity of the constitution of port folio of units
     *
     * @param displayCourse
     * @param context
     *
     * @return
     */
    public boolean createCourse(DisplayCourse displayCourse, final long trainningId, MessageContext context);

    /**
     * delete a course by id
     *
     * @param id
     * @param context
     *
     * @return
     */
    public boolean deleteCourseById(long id, MessageContext context);

    /**
     * update a course
     */
    public boolean updateCourseById(DisplayCourse displayCourse, MessageContext context);

}
